package com.bdpn.ch05.service.impl;

import com.bdpn.ch05.mapper.UserMapper;
import com.bdpn.ch05.pojo.SysUser;
import com.bdpn.ch05.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public SysUser login(String usrName, String usrPassword) {
        return userMapper.login(usrName , usrPassword);
    }

    @Override
    public int addUser(SysUser sysUser) {
        return userMapper.addUser(sysUser);
    }

    @Override
    public int deleteUser(Long usrId) {
        return userMapper.deleteUser(usrId);
    }

    @Override
    public int updateUser(SysUser user) {
        return userMapper.updateUser(user);
    }

    @Override
    public SysUser getUser(Long usrId) {
        return userMapper.getUser(usrId);
    }

    @Override
    public List<SysUser> findAllUsers() {
        return userMapper.findAllUsers();
    }
}
